package com.wiser.ohosservice;

import com.wiser.ohosservice.slice.MainAbilitySlice;
import ohos.aafwk.ability.Ability;
import ohos.aafwk.content.Intent;

/**
 * 启动前台服务需要添加权限
 * "module":{
 *    "reqPermissions": [
 *         {
 *          "name": "ohos.permission.KEEP_BACKGROUND_RUNNING"
 *         }
 *       ]
 * }
 * {
 *         "name": "***.ServiceAbility",
 *         "type": "service",
 *         "visible": true,
 *         // 以下必须添加
 *         "backgroundModes": [
 *           "dataTransfer",
 *           "location"
 *         ]
 *       }
 *
 */
public class MainAbility extends Ability {
    @Override
    public void onStart(Intent intent) {
        super.onStart(intent);
        super.setMainRoute(MainAbilitySlice.class.getName());
    }
}
